package com.javasix;

public class Test {
    //主线程--守护线程
    public static void main(String[] args) throws Exception{
       /* for (int i = 1; i <= 5; i++) {
            Demo1 demo1 = new Demo1();
            demo1.setName("demo"+i);
            demo1.start();
        }*/
        Demo2 demo2 = new Demo2();
        Demo2 demo3 = new Demo2();
        //条件竞争
        Thread thread = new Thread(demo2,"thread1");
        Thread thread1 = new Thread(demo3,"thread1");

        thread.start();
        thread1.start();
    }
}
